<h1>ระบบจัดเก็บเอกสาร</h1>
<ul id="breadcrumb">
	<li><span>ระบบจัดเก็บเอกสาร</span></li>	
</ul>
<div id="content">
	<div class="search">
		<form method="get">
		  <label>ชื่อไฟล์</label> <input type="text" name="search" value="<?php echo (!empty($_GET['search']))?$_GET['search']:'' ?>" />
		  &nbsp;<input type="submit" value="<?php echo lang('search'); ?>" class="button" />
		</form>
	</div>
<table class="list">
	<tr>
		<th>ไฟล์</th>
		<th width="200"><a href="files/form" class="button"><span class="icon_text addnew"></span>เพิ่มรายการ</a></th>
	</tr>
	<? foreach($result as $key => $item): ?>
	<tr <?php echo cycle($key) ?>>
		<td><?php echo anchor('files/download/'.$item['id'], $item['filename']); ?></td>
		<td class="center"><a href="files/form/<?php echo $item['id'] ?>" class="button"><span class="icon_text edit"></span>แก้ไข</a> <a href="files/delete/<?php echo $item['id'] ?>" onclick="return confirm('<?php echo lang('confirm_delete')?>')" class="button"><span class="icon_text cancel"></span>ลบ</a></td>
	</tr>
	<? endforeach; ?>
</table>
	<?php echo $pagination ?>
</div>